﻿using System;
using System.Net;
using System.Runtime.Serialization;

namespace Airport
{
    [DataContract]
    public class Flight
    {
        private int _flightId;
        private string _airlineCode;
        private int _flightNumber;
        private int _squawk;
        private bool _isActive;
        private Plane _plane;

        public Flight()
            : this(-1, "", -1, -1, false, new Plane())
        {
        }

        public Flight(int inFlightId, string inAirlineCode, int inFlightNumber, int inSquawk, bool inIsActive, Plane inPlane)
        {
            _flightId = inFlightId;
            _airlineCode = inAirlineCode;
            _flightNumber = inFlightNumber;
            _squawk = inSquawk;
            _isActive = inIsActive;
            _plane = inPlane;
        }

        [DataMember]
        public int flightId
        {
            get { return _flightId; }
           
            set
            {
                if (_flightId != value)
                {
                    _flightId = value;
                }
            }
        }

        [DataMember]
        public string airlineCode
        {
            get { return _airlineCode; }
           
            set
            {
                if (_airlineCode != value)
                {
                    _airlineCode = value;
                }
            }
        }

        [DataMember]
        public int flightNumber
        {
            get { return _flightNumber; }
            
            set
            {
                if (_flightNumber != value)
                {
                    _flightNumber = value;
                }
            }
        }

        [DataMember]
        public int squawk
        {
            get { return _squawk; }
           
            set
            {
                if (_squawk != value)
                {
                    _squawk = value;
                }
            }
        }

        [DataMember]
        public bool isActive
        {
            get { return _isActive; }
            
            set
            {
                if (_isActive != value)
                {
                    _isActive = value;
                }
            }
        }

        [DataMember]
        public Plane plane
        {
            get { return _plane; }
          
            set
            {
                if (_plane != value)
                {
                    _plane = value;
                }
            }
        }

        
    }
}
